var windowName = "userLike";
var Page
apiready = function(){
    onWindowShow(function () {
    })
    onWindowHide(function () {
    })
    console.log("index page is OK");
    Page = createVM("#Page",{
        //页面数据
        list:[]
    },{
        //页面方法
        "init":function () {
            getData(this)
        }
        ,play:function (title,url) {
            var videoPlayer = api.require('videoPlayer');
            videoPlayer.play({
                texts: {
                    head: {
                        title: title
                    }
                },
                styles: {
                    head: {
                        bg: 'rgba(0.5,0.5,0.5,0.7)',
                        height: 30,
                        titleSize: 20,
                        titleColor: '#fff',
                        backSize: 24,
                        backImg: 'fs://img/back.png',
                        setSize: 0,
                        setImg: 'fs://img/set.png'
                    },
                    foot: {
                        bg: 'rgba(0.5,0.5,0.5,0.7)',
                        height: 30,
                        playSize: 24,
                        playImg: 'fs://img/back.png',
                        pauseImg: 'fs://img/back.png',
                        nextSize: 0,
                        nextImg: 'fs://img/back.png',
                        timeSize: 14,
                        timeColor: '#fff',
                        sliderImg: 'fs://img/slder.png',
                        progressColor: '#696969',
                        progressSelected: '#76EE00'
                    }
                },
                path: url, //（可选项）字符串类型；文档的路径，支持网络和本地（fs://）路径；默认：未传值时不播放
                //在 android 平台上不支持 widget://
                autoPlay: true //（可选项）布尔类型；打开时是否自动播放；默认：true（自动播放）
                ,autorotation:false
            }, function(ret, err) {
                if (ret) {
                    log(JSON.stringify(ret));
                } else {
                    log(JSON.stringify(err));
                }
            });
        }
    })
    Page.init()
}
function getData(_this) {
    startPullDownRefresh();
    apiGet("/app/get/like",{},function (res) {
        stopPullDownRefresh();
        stopPullUpLoadMore();
        logJson(res)
        _this.list = res.d
    })
}